<?php (!defined('IN_SYSTEM') || !defined('ADMIN_PRE')) && exit('Access Denied!');?>
{admintemplate header}
<div class="box">
	<div class="heading">
	<h1>订单管理</h1>
	<div class="buttons">
	<a href="{url admin.php?m=order}" >订单数据统计</a>
	<a href="{url admin.php?m=order&f=olist}" >商品交易订单</a>
	<a href="{url admin.php?m=order&f=olist}" >积分充值订单</a>
	
	</div>
	</div>
	<div class="main">
	
	{if $_REQUEST['f']=='edit'}
	<div class="mt"><h3>商品信息</h3><div class="fr"></div></div>
	
	<table width="100%" class="uc_tableb"><tbody>
	{if $data['type']=='pointpay'}
	<tr><th colspan="6">购买积分</th></tr>
	{if $data['amount']}
	<tr><td  colspan="6">{$setting[$_G['settings']['point']['pointuse']]['title']}：{$data['amount']}</td></tr>
	{else}
	<tr><td colspan="6" >-</td></tr>
	{/if}
	{else}
						<tr>
							<th width="10%">商品编号</th>
							<th width="45%">商品名称</th>
							<th width="10%">商品单价</th>
							<th width="10%">赠送积分</th>
							<th width="10%">商品数量</th>
							<th width="100">操作</th>
						</tr>
						{loop $goods $good}
						<tr>
						    <td>{$good['pid']}</td>
						    <td>{$good['title']}</td>
						    <td><strong>￥{price($good['price'])}</strong></td>
						    {php $goodsp+=$good['price'];}
						    <td>{$good['credit']}</td>
						    <td>{$good['qty']}</td>
						    <td>{$good['sku']}</td>
						</tr>
						{/loop}
						{if empty($goods)}
						<tr><td colspan="6" >-</td></tr>
						{/if}
	{/if}	
	</tbody></table>
					    		  
			  
	<table class="uc_tableb">
		<tbody><tr><th align="left"><strong>订单信息</strong></th></tr>
		<tr><td><div><input type="hidden" name="street1" value="{$data['street1']}" id="street1"/>
		订单编号：{$id}<br>
		支付方式：{$lang[$data['payment_type']]}<br>
		{if $data['shipping_type']}配送方式：{$lang[$data['shipping_type']]}<br>{/if}
		下单时间：{gdate('Y-m-d H:i:s',$data['created'])}<br>
		{if $data['trade_no']}{$lang[$data['payment_type']]}订单号：{$data['trade_no']}<br>{/if}
		</div></td></tr>
		<tr><td><div>
			<strong>收货人信息</strong><br><br>
			收货人姓名：<input type="text" name="shipping[firstname]" value="{$data['firstname']}"/><br><br>
			收货地址：{$region}<input type="text" name="shipping[street]" value="{$data['street']}"/>&nbsp; &nbsp;邮编：<input type="text" name="shipping[zip]" value="{$data['zip']}"/><br><br>
			固定电话：<input type="text" name="shipping[tel]" value="{$data['tel']}"/>  
			手机号码：<input type="text" name="shipping[phone]" value="{$data['phone']}"/>      <br/><br>
			电子邮件：<input type="text" name="shipping[mail]" value="{$data['mail']}"/>
		</div></td></tr>
		<tr><td><div>
			<strong>订单备注</strong><br/>
			<textarea  name="txn[data]" cols="41">{$data['data']}</textarea>
		</div></td></tr>
		<tr><td><div>
			<strong>结算信息</strong><br/>
商品金额：{price($goodsp)}元 + 
运费：<input type="text" name="txn[shipping_cost]" value="{price($data['shipping_cost'])}"/>元
{if $data['amount']}
 + 积分充值：<input type="text" name="txn[amount]" value="{price($data['amount']*$ratio)}"/>元
{/if} 

 = 
<strong class="h1">订单总金额：<span class="red"><input type="text" name="txn[gross]" value="{$data['gross']}"/>元</span></strong>
		</div></td></tr> 
		</tbody>
	</table>	
	<script type="text/javascript">
			function region(obj,le){
				var val=$(obj).val();
				if(val<1 && le>0 && $("#level"+(le-1)).val() >0){
					$(".searchid").val($("#level"+(le-1)).val());
				}else{
					$(".searchid").val(val);
				}
				var ht='';
				var lev=le;
				if(val<1){
					lev=lev-1;
					if(lev<1){
						$('#street1').val("");
					}
				}
				for(var i=1;i<=lev;i++){
						ht=ht+$("#level"+i).find("option:selected").text();
						$('#street1').val(ht);
				}
				if($(obj).val()<1){
					$('#level'+(le+1)).remove();
					$('#level'+(le+2)).remove();
					$('#level'+(le+3)).remove();
					return ;
				}
				$.getJSON('home.php?m=addr&f=ajax&id='+$(obj).val()+'&tm='+Math.random(),'',function(data){
					if(data.status==true){
						$('#level'+(le+1)).remove();
						$('#level'+(le+2)).remove();
						$('#level'+(le+3)).remove();
						$(data.data).insertAfter($('#level'+le));
					}else{
					}
					});
			}
			</script>
	{/if}
	
	</div>
</div>	
{admintemplate footer}